/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/layout'

const purchaseRouter = {
  path: '/views/purchaseManage',
  component: Layout,
  //当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
  redirect: 'noRedirect',
  // alwaysShow: true, //一直显示根路由
  name: 'purchaseManage',
  meta: {
    title: '采购管理',
    icon: 'purchase',
    roles: ['admin', 'user']
  }, //你可以在根路由设置权限，这样它下面所有的子路由都继承了这个权限
  children: [
    {
      path: '/views/purchaseManage/purchaseBill',
      component: () => import('@/views/purchaseManage/purchaseBill/index'),
      //当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
      redirect: 'noRedirect',
      // alwaysShow: true, //一直显示根路由
      meta: {
        title: '单据',
        roles: ['admin', 'user']
      }, //你可以在根路由设置权限，这样它下面所有的子路由都继承了这个权限
      children: [{
          path: '/views/purchaseManage/purchaseBill/billPurchaseOrder',
          component: () => import('@/views/purchaseManage/purchaseBill/billPurchaseOrder'), // 采购订单
          name: 'billPurchaseOrder',
          meta: {
            title: '采购订单',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/purchaseManage/purchaseBill/billPurchaseWarehousing',
          component: () => import('@/views/purchaseManage/purchaseBill/billPurchaseWarehousing'), // 采购入库
          name: 'billPurchaseWarehousing',
          meta: {
            title: '采购入库',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/purchaseManage/purchaseBill/billPurchaseReturn',
          component: () => import('@/views/purchaseManage/purchaseBill/billPurchaseReturn'), // 采购退货
          name: 'billPurchaseReturn',
          meta: {
            title: '采购退货',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/purchaseManage/purchaseBill/billPurchaseExchange',
          component: () => import('@/views/purchaseManage/purchaseBill/billPurchaseExchange'), // 采购换货
          name: 'billPurchaseExchange',
          meta: {
            title: '采购换货',
            roles: ['admin', 'user']
          }
        },

      ]
    },
    {
      path: '/views/purchaseManage/purchaseRecord',
      component: () => import('@/views/purchaseManage/purchaseRecord/index'),
      //当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
      redirect: 'noRedirect',
      // alwaysShow: true, //一直显示根路由
      meta: {
        title: '记录',
        roles: ['admin', 'user']
      }, //你可以在根路由设置权限，这样它下面所有的子路由都继承了这个权限
      children: [{
          path: '/views/purchaseManage/purchaseRecord/purchaseOrder',
          component: () => import('@/views/purchaseManage/purchaseRecord/purchaseOrder'), // 采购订单记录
          name: 'purchaseOrder',
          meta: {
            title: '采购订单记录',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/purchaseManage/purchaseRecord/purchaseWarehousing',
          component: () => import('@/views/purchaseManage/purchaseRecord/purchaseWarehousing'), // 采购入库记录
          name: 'purchaseWarehousing',
          meta: {
            title: '采购入库记录',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/purchaseManage/purchaseRecord/purchaseReturn',
          component: () => import('@/views/purchaseManage/purchaseRecord/purchaseReturn'), // 采购退货记录
          name: 'purchaseReturn',
          meta: {
            title: '采购退货记录',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/purchaseManage/purchaseRecord/purchaseExchange',
          component: () => import('@/views/purchaseManage/purchaseRecord/purchaseExchange'), // 采购换货记录
          name: 'purchaseExchange',
          meta: {
            title: '采购换货记录',
            roles: ['admin', 'user']
          }
        },

      ]
    },
    {
      path: '/views/reportStatistics/purchaseReport',
      component: () => import('@/views/reportStatistics/purchaseReport/index'),
      //当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
      redirect: 'noRedirect',
      // alwaysShow: true, //一直显示根路由
      meta: {
        title: '统计',
        roles: ['admin', 'user']
      }, //你可以在根路由设置权限，这样它下面所有的子路由都继承了这个权限
      children: [{
          path: '/views/reportStatistics/purchaseReport/orderExecution',
          component: () => import('@/views/reportStatistics/purchaseReport/orderExecution'),// 采购订单执行情况
          name: 'orderExecution',
          meta: {
            title: '采购订单执行情况',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/reportStatistics/purchaseReport/orderStatistics',
          component: () => import('@/views/reportStatistics/purchaseReport/orderStatistics'), // 采购订单统计
          name: 'orderStatistics',
          meta: {
            title: '采购订单统计',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/reportStatistics/purchaseReport/orderDetailsQuery',
          component: () => import('@/views/reportStatistics/purchaseReport/orderDetailsQuery'), // 采购订单明细查询
          name: 'orderDetailsQuery',
          meta: {
            title: '采购订单明细查询',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/reportStatistics/purchaseReport/purchaseDtails',
          component: () => import('@/views/reportStatistics/purchaseReport/purchaseDtails'), // 采购明细查询
          name: 'purchaseDtails',
          meta: {
            title: '采购明细查询',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/reportStatistics/purchaseReport/statisticsByCommodity',
          component: () => import('@/views/reportStatistics/purchaseReport/statisticsByCommodity'), // 采购统计(按商品)
          name: 'statisticsByCommodity',
          meta: {
            title: '采购统计(按商品)',
            roles: ['admin', 'user']
          }
        },
        {
          path: '/views/reportStatistics/purchaseReport/statisticsBySupplier',
          component: () => import('@/views/reportStatistics/purchaseReport/statisticsBySupplier'), // 采购统计(按供应商)
          name: 'statisticsBySupplier',
          meta: {
            title: '采购统计(按供应商)',
            roles: ['admin', 'user']
          }
        },
      ]
    },
  ]
}
export default purchaseRouter
